<%@ page import="com.domain.UserEntity" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
    Object obj = session.getAttribute("user");
    UserEntity userEntity = new UserEntity();
    if (obj != null) {
        userEntity = (UserEntity) obj;
    }

%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>学生管理系统</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        a{
            cursor: pointer;
        }
        iframe{
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">studentManage</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">

<%--            <li class="layui-nav-item">--%>
<%--                <a href="javascript:;">其它系统</a>--%>
<%--                <dl class="layui-nav-child">--%>
<%--                    <dd><a href="">邮件管理</a></dd>--%>
<%--                    <dd><a href="">消息管理</a></dd>--%>
<%--                    <dd><a href="">授权管理</a></dd>--%>
<%--                </dl>--%>
<%--            </li>--%>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    <%out.print(userEntity.getUsername());%>
                </a>
                <dl class="layui-nav-child">
                    <dd><a onclick="goRoute('/updatePassword.jsp')">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/">注销</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">学生管理</a>
                    <dl class="layui-nav-child">
                        <dd><a onclick="goRoute('/student.jsp')">学生</a></dd>

                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe src="/student.jsp">

        </iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->

    </div>
</div>
<script src="/static/layui/layui.js"></script>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
    layui.use(['element','layer','form'], function () {

        const element = layui.element;
        const layer = layui.layer;
        const form = layui.form;
        //页面层-自定义

        // layer.open({
        //     type: 1,
        //     title: false,
        //     closeBtn: 0,
        //     shadeClose: true,
        //     skin: 'yourclass',
        //     content: '<div></div>'
        // });
    });

    function goRoute(url) {
        console.log("iframe url",url)
        $('iframe').attr("src",url);
    }
</script>

</body>
</html>
